const { VM, VMScript } = require("vm2");
const currentDir = __dirname;
const fs = require("fs");
const vm = new VM();

var code = fs.readFileSync(`${currentDir}/enviroment.js`);
code += fs.readFileSync(`${currentDir}/code.js`);

// console.log("-> 11111 <-");
debugger;

function get_encrypt() {
  var res = vm.run(code);
  console.log(res);
  return res;
}

get_encrypt();
debugger;
console.log("正确结果: 43e325a571c95f21256a1b37131f880e355738c11c1dca5979bd43862d92e306");

// 正确的输出应该是:
//  be727422b2c51e6f62fe934f20e023bd39667628c0c4a143fc24c9a9564db142

// be77<L(Db2ª9QQ62Qi<CrzQ0Q0QH|39Q6L@ZPc0c4g:S:fc2Ec;µ256}c41*

// be77<L(Db2ª9QQ62Qi<Cp}Q0Q0QAm~3966798>c0c4g33&fc2Ec;¢(56}c41,
// be77<L(Db2ª9QQ62Qi<Cp}Q0Q0QAm~3966798>c0c4g33&fc2Ec;¢(56}c41,
// be77<L(Db2ª9QQq62fi<C0gQ0Q0QAmi3966798>c0c4g33&fc2Ec;¢(56}c41,
// be77<L(Db2ª9QQq62fi<C0gQ0Q0QAmi3966798>c0c4g33&fc2Ec;¢(56}c41,

// be727422b2c5QeQf62fe934f20e023bd39667628c0c4a14%fc24c9£*564db14/

// be727422b2c51eQf62fe934f20e023bd39667628c0c4a143fc24c9a9564db14D   正则检测

